package com.hoshiicloud.user.param.rbac;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiicloud.common.query.PageParam;
import com.hoshiicloud.rbac.entity.SysPlatform;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * <p>
 * 查询系统组织参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-27
 */
@Data
public class SysPlatformQueryParam extends PageParam implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@ApiModelProperty(value = "ID")
	private Long id;

	/**
	 * 组织名称
	 */
	@ApiModelProperty(value = "组织名称")
	private String name;

	/**
	 * 组织描述
	 */
	@ApiModelProperty(value = "组织描述")
	private String description;

	/**
	 * 电话
	 */
	@ApiModelProperty(value = "电话")
	private String telphone;

	/**
	 * 传真
	 */
	@ApiModelProperty(value = "传真")
	private String fax;

	/**
	 * 地址
	 */
	@ApiModelProperty(value = "地址")
	private String address;

	/**
	 * 负责人
	 */
	@ApiModelProperty(value = "负责人")
	private String charge;

	public QueryWrapper<SysPlatform> convertToQueryWrapper() {
		QueryWrapper<SysPlatform> queryWrapper = new QueryWrapper<SysPlatform>();
		queryWrapper.eq(this.id != null, "id", this.id);
		queryWrapper.eq(StringUtils.isNotBlank(this.name), "name", this.name);
		queryWrapper.eq(StringUtils.isNotBlank(this.description), "description", this.description);
		queryWrapper.eq(StringUtils.isNotBlank(this.telphone), "telphone", this.telphone);
		queryWrapper.eq(StringUtils.isNotBlank(this.fax), "fax", this.fax);
		queryWrapper.eq(StringUtils.isNotBlank(this.address), "address", this.address);
		queryWrapper.eq(StringUtils.isNotBlank(this.charge), "charge", this.charge);
		return queryWrapper;
	}
}
